require("utils")
local utils = utils
local pairs = pairs
local rawget = rawget
local assert = assert
local setmetatable = setmetatable
local type = type

module("eq")

head = {
	grull = {
		stat = {
			armor = 321,
			stamina = 34,
			intellect = 42,
			spirit = 34,
			healing = 92,
			spelldamage = 31,
		}
	},
	za = {
		stat = { -- ZA
			armor = 328,
			stamina = 33,
			intellect = 39,
			spirit = 30,
			healing = 86,
			spelldamage= 1,
		},
		socket1 = "red",
		socket2 = "yellow",
		socket3 = "blue",
		socket_bonus = {
			healing = 9,
		}
	},
	t5 = {
		set = "t5",
		stat = {
			armor = 341,
			stamina = 40,
			intellect = 28,
			spirit = 31,
			healing = 103,
			spelldamage = 35,
			manareg = 8,
		},
		socket1 = "meta",
		socket2 = "yellow",
		socket_bonus = {
			manareg = 2,
		},
	},
	t6 = {
		set = "t6",
		stat = {
			armor = 373,
			stamina = 42,
			intellect = 42,
			spirit = 28,
			healing = 117,
			spelldamage = 39,
			manareg = 8,
		},
		socket1 = "blue",
		socket2 = "meta",
		socket_bonus = {
			healing = 9,
		},
	},
	w_t4 = {
		set = "w_t4",
		stat = {
			armor = 1227,
			strength = 15,
			agility = 17,
			stamina = 53,
			cr_skill_defense = 24,
			cr_block = 19,
			blockvalue = 39,
		},
		socket1 = "meta",
		socket2 = "yellow",
		socket_bonus = {
			cr_block = 4,
		}
	},
	f_t5 = {
		set = "f_t5",
		stat = {
			armor = 1355,
			strength = 47,
			stamina = 45,
			cr_hit = 21,
			cr_crit = 36,
		},
		socket1 = "meta",
		socket2 = "blue",
		socket_bonus = {
			strength = 4,
		}
	},
}

neck = {
	nether = {
		stat = {
			stamina = 18,
			intellect = 21,
			spirit = 19,
			healing = 46,
			spelldamage = 16,
		}
	},
	w_maiden = {
		stat = {
			stamina = 39,
			cr_skill_defense = 16,
			cr_dodge = 21,
		},
	},
	f_lurker = {
		stat = {
			stamina = 24,
			cr_crit = 23,
			attackpower = 64,
		},
	},
}

shoulders = {
	za_badge = {
		stat = {
			armor = 303,
			stamina = 21,
			intellect = 23,
			spirit = 26,
			healing = 73,
			spelldamage = 25,
		},
		socket1 = "red",
		socket2 = "yellow",
		socket_bonus = {
			healing = 7,
		}
	},
	vashj = {
		stat = {
			armor = 326,
			stamina = 31,
			intellect = 22,
			spirit = 32,
			healing = 101,
		},
	},
	t5 = {
		set = "t5",
		stat = {
			armor = 314,
			stamina = 26,
			intellect = 27,
			spirit = 16,
			healing = 77,
			spelldamage = 26,
			manareg = 6,
		},
		socket1 = "blue",
		socket2 = "blue",
		socket_bonus = {
			healing = 7,
		}
	},
	t6 = {
		set = "t6",
		stat = {
			armor = 344,
			stamina = 30,
			intellect = 31,
			spirit = 19,
			healing = 86,
			spelldamage = 29,
			manareg = 7,
		},
		socket1 = "blue",
		socket2 = "blue",
		socket_bonus = {
			healing = 7,
			spelldamage = 3
		}
	},
	w_d3 = {
		set = "w_d3",
		stat = {
			armor = 873,
			strength = 25,
			stamina = 25,
			cr_skill_defense = 17,
		},
		socket1 = "yellow",
		socket2 = "blue",
		socket_bonus = {
			cr_dodge = 3,
		},
	},
	f_t5 = {
		set = "f_t5",
		stat = {
			armor = 1251,
			strength = 36,
			stamina = 38,
			cr_hit = 18,
			cr_crit = 20,
		},
		socket1 = "yellow",
		socket2 = "blue",
		socket_bonus = {
			strength = 3,
		},
	}
}

back = {
	prince = {
		stat = {
			armor = 105,
			stamina = 22,
			intellect = 23,
			healing = 53,
			spelldamage = 18,
			manareg = 7,
		}
	},
	kaelthas = {
		stat = {
			armor = 116,
			stamina = 18,
			intellect = 24,
			spirit = 20,
			healing = 77,
		},
	},
	gurtogg = {
		stat = {
			armor = 118,
			stamina = 27,
			intellect = 19,
			spirit = 20,
			healing = 79,
			spelldamage = 27,
		},
	},
	w_badge = {
		stat = {
			armor = 346,
			stamina = 37,
			cr_skill_defense = 16,
			cr_dodge = 25,
		},
	},
	f_morogrim = {
		stat = {
			armor = 108,
			strength = 33,
			agility = 23,
			stamina = 22,
		},
	},
}

chest = {
	morogrim = {
		stat = {
			armor = 404,
			stamina = 48,
			intellect = 32,
			spirit = 34,
			healing = 110,
			spelldamage = 37,
		},
	},
	t5 = {
		set = "t5",
		stat = {
			armor = 419,
			stamina = 36,
			intellect = 33,
			spirit = 31,
			healing = 103,
			spelldamage = 35,
		},
		socket1 = "blue",
		socket2 = "blue",
		socket3 = "blue",
		socket_bonus = {
			healing = 9,
		},
	},
	t6 = {
		set = "t6",
		stat = {
			armor = 459,
			stamina = 42,
			intellect = 34,
			spirit = 33,
			healing = 117,
			spelldamage = 39,
			manareg = 8,
		},
		socket1 = "yellow",
		socket2 = "blue",
		socket3 = "blue",
		socket_bonus = {
			healing = 9,
		},
	},
	badge_hauthaa = {
		stat = {
			armor = 444,
			stamina = 34,
			intellect = 40,
			spirit = 46,
			healing = 118,
			spelldamage = 37,
		},
		socket1 = "red",
		socket_bonus = {
			spirit = 2,
		},
	},
	w_sepethrea = {
		stat = {
			armor = 1164,
			strength = 30,
			stamina = 50,
			cr_skill_defense = 25,
			cr_block = 23,
		},
	},
	w_d3 = {
		stat = {
			armor = 1164,
			strength = 23,
			agility = 21,
			stamina = 33,
			cr_skill_defense = 19,
		},
		socket1= "red",
		socket2= "red",
		socket3= "blue",
		socket_bonus = {
			cr_skill_defense = 4,
		},
	},
	f_t5 = {
		set = "f_t5",
		stat = {
			armor = 1668,
			strength = 50,
			stamina = 48,
			cr_hit = 15,
			cr_crit = 33,
		},
		socket1 = "yellow",
		socket2 = "blue",
		socket3 = "red",
		socket_bonus = {
			strength = 4,
		}
	},
}

wrists = {
	lurker = {
		stat = {
			armor = 177,
			stamina = 21,
			intellect = 14,
			spirit = 21,
			healing = 68,
			spelldamage = 23,
		},
	},
	rage = {
		stat = {
			armor = 194,
			stamina = 16,
			intellect = 20,
			spirit = 28,
			healing = 64,
			spelldamage = 22,
		},
		socket1 = "blue",
		socket_bonus = {
			healing = 4,
			spelldamage = 1,
		}
	},
	w_h_kalithresh = {
		stat = {
			armor = 608,
			strength = 22,
			agility = 18,
			stamina = 25,
			cr_skill_defense = 15,
		},
	},
	f_lurker = {
		stat = {
			armor = 703,
			strength = 25,
			stamina = 12,
			cr_hit = 17,
			cr_crit = 24,
		},
		socket1 = "blue",
		socket_bonus = {
			strength = 2
		},
	},
}

mainhand = {
	nightbane = {
		stat = {
			stamina = 33,
			intellect = 34,
			spirit = 55,
			healing = 348,
			spelldamage = 116,
		},
	},
	solarian = {
		stat = {
			stamina = 52,
			intellect = 44,
			spirit = 62,
			healing = 415,
			spelldamage = 138,
		},
	},
	kt_legendary = {
		stat = {
			stamina = 40,
			intellect = 40,
			spirit = 40,
			healing = 600,
			spelldamage = 200,
			manareg = 30,
		},
	},
	malchezaar = {
		stat = {
			stamina = 16,
			intellect = 21,
			spirit = 20,
			healing = 382,
			spelldamage = 128,
		},
	},
	kargath = {
		stat = {
			stamina = 16,
			cr_expertise = 17,
			attackpower = 28,
		},
	},
	w_h_omor = {
		stat = {
			stamina = 19,
			cr_skill_defense = 15,
			cr_hit = 14,
		},
	},
	f_alar = {
		stat = {
			cr_hit = 15,
			cr_crit = 19,
			attackpower = 52,
		},
	},
}

hands = {
	eye_trash = {
		stat = {
			armor = 252,
			stamina = 28,
			intellect = 25,
			spirit = 33,
			healing = 73,
			spelldamage = 25,
		},
	},
	t5 = {
		set = "t5",
		stat = {
			armor = 262,
			stamina = 26,
			intellect = 27,
			spirit = 24,
			healing = 77,
			spelldamage = 26,
			manareg = 9,
		},
	},
	t6 = {
		set = "t6",
		stat = {
			armor = 287,
			stamina = 30,
			intellect = 31,
			spirit = 27,
			healing = 86,
			spelldamage = 29,
			manareg = 7,
		},
		socket1 = "blue",
		socket_bonus = {
			healing = 4,
			spelldamage = 2,
		},
	},
	w_d3 = {
		stat = {
			armor = 728,
			strength = 17,
			agility = 16,
			stamina = 31,
			cr_skill_defense = 14,
		},
		socket1 = "red",
		socket2 = "yellow",
		socket_bonus = {
			cr_parry = 3,
		},
	},
	f_t5 = {
		set = "f_t5",
		stat = {
			armor = 1042,
			strength = 44,
			stamina = 46,
			cr_crit = 30,
		},
	},
}

waist = {
	void = {
		stat = {
			armor = 227,
			stamina = 22,
			intellect = 23,
			spirit = 24,
			healing = 73,
			spelldamage = 25,
		},
		socket1 = "blue",
		socket2 = "blue",
		socket_bonus = {
			healing = 7,
		},
	},
	w_badge = {
		stat = {
			armor = 904,
			stamina = 45,
			cr_skill_defense = 21,
			cr_dodge = 33,
		},
		socket1 = "blue",
		socket2 = "yellow",
		socket_bonus = {
			cr_dodge = 3,
		},
	},
	f_badge = {
		stat = {
			armor = 904,
			strength = 34,
			stamina = 37,
			cr_hit = 14,
			ignorearmor = 154,
		},
		socket1 = "red",
		socket2 = "blue",
		socket_bonus = {
			cr_hit = 3,
		},
	},
	za_timer = {
		stat = {
			armor = 227,
			stamina = 20,
			intellect = 23,
			spirit = 22,
			healing = 75,
			spelldamage = 25,
			manareg = 6,
		},
		socket1 = "red",
		socket2 = "blue",
		socket_bonus = {
			healing = 7,
			spelldamage = 3,
		},
	}
}

legs = {
	t5 = {
		set = "t5",
		stat = {
			armor = 367,
			stamina = 37,
			intellect = 36,
			spirit = 27,
			healing = 101,
			spelldamage = 34,
			manareg = 11,
		},
		socket1 = "blue",
		socket_bonus = {
			healing = 4,
		},
	},
	t6 = {
		set = "t6",
		stat = {
			armor = 401,
			stamina = 34,
			intellect = 40,
			spirit = 36,
			healing = 117,
			spelldamage = 39,
			manareg = 11,
		},
		socket1 = "blue",
		socket_bonus = {
			healing = 4,
			spelldamage = 2,
		},
	},
	badge_hauthaa = {
		stat = {
			armor = 388,
			stamina = 36,
			intellect = 42,
			spirit = 44,
			healing = 114,
			spelldamage = 38,
		},
		socket1 = "blue",
		socket2 = "red",
		socket_bonus = {
			spirit = 3,
		},
	},
	w_kargath = {
		stat = {
			armor = 1019,
			strength = 25,
			stamina = 37,
			cr_skill_defense = 25,
		},
		socket1 = "red",
		socket2 = "yellow",
		socket3 = "red",
		socket_bonus = {
			blockvalue = 6,
		}
	},
	c_solarian = {
		stat = {
			armor = 188,
			stamina = 27,
			intellect = 27,
			spirit = 52,
			healing = 101,
			spelldamage = 34,
		},
	},
	f_t5 = {
		set = "f_t5",
		stat = {
			armor = 1459,
			strength = 52,
			stamina = 57,
			cr_hit = 22,
			cr_crit = 32,
		},
		socket1 = "red",
		socket_bonus = {
			cr_crit = 2
		},
	},
	w_badge = {
		stat = {
			armor = 1406,
			stamina = 73,
			cr_skill_defense = 22,
			cr_block = 30,
			blockvalue = 59,
		},
		socket1 = "red",
		socket2 = "yellow",
		socket3 = "blue",
		socket_bonus = {
			stamina = 6,
		},
	},
}

feet = {
	chess = {
		stat = {
			armor = 250,
			stamina = 24,
			intellect = 27,
			spirit = 16,
			healing = 55,
			spelldamage = 19,
		},
		socket1 = "blue",
		socket2 = "blue",
		socket_bonus = {
			healing = 7,
		},
	},
	leotheras = {
		stat = {
			armor = 278,
			stamina = 19,
			intellect = 27,
			spirit = 19,
			healing = 73,
		},
		socket1 = "blue",
		socket2 = "blue",
		socket_bonus = {
			spirit = 3,
		},
	},
	anetheron = {
		stat = {
			armor = 305,
			stamina = 34,
			intellect = 29,
			spirit = 37,
			healing = 84,
			spelldamage = 28,
		},
	},
	w_remparts = {
		stat = {
			armor = 600,
			strength = 14,
			stamina = 19,
			cr_skill_defense = 19,
		},
		socket1 = "red",
		socket2 = "blue",
		socket_bonus = {
			cr_skill_defense = 3,
		},
	},
	w_h_furnace = {
		stat = {
			armor = 955,
			strength = 29,
			agility = 21,
			stamina = 33,
			cr_skill_defense = 24,
		},
	},
	f_morogrim = {
		stat = {
			armor = 1105,
			strength = 44,
			stamina = 29,
			cr_crit = 31,
		},
	},
}

finger = {
	heroic_black_stalker = {
		stat = {
			intellect = 12,
			spirit = 11,
			healing = 59,
			spelldamage = 20,
		},
	},
	karazhan_exalted = {
		stat = {
			stamina = 24,
			intellect = 23,
			spirit = 17,
			healing = 55,
			spelldamage = 19,
		},
	},
	vashj = {
		stat = {
			stamina = 21,
			intellect = 14,
			spirit = 27,
			healing = 75,
			spelldamage = 25,
		},
	},
	sunwell = {
		stat = {
			stamina = 31,
			intellect = 22,
			spirit = 32,
			healing = 73,
			spelldamage = 25,
		},
	},
	hyjal1 = {
		stat = {
			stamina = 24,
			intellect = 22,
			healing = 55,
			spelldamage = 19,
			manareg = 8,
		},
	},
	hyjal2 = {
		stat = {
			stamina = 25,
			intellect = 23,
			healing = 59,
			spelldamage = 20,
			manareg = 9,
		},
	},
	hyjal3 = {
		stat = {
			stamina = 28,
			intellect = 25,
			healing = 64,
			spelldamage = 22,
			manareg = 10,
		},
	},
	w_kara_blue = {
		stat = {
			armor = 294,
			stamina = 27,
			cr_skill_defense = 13,
		},
	},
	w_h_mana = {
		stat = {
			stamina = 27,
			cr_skill_defense = 22,
			cr_hit = 16,
		},
	},
	f_lurker = {
		stat = {
			strength = 32,
			agility = 21,
			stamina = 30,
		},
	},
	f_kara = {
		stat = {
			stamina = 28,
			cr_hit = 25,
			attackpower = 56,
		},
	},
}

trinket = {
	bwl_rejuv = {
		stat = {
			healing = 66,
			spelldamage = 22,
			manareg = 9,
		},
	},
	kara_opera = {
		stat = {
			healing = 73,
			spelldamage = 25,
		},
	},
	kara_aran = {
		stat = {
			intellect = 40,
		},
	},
	slab_def = {
		stat = {
			cr_skill_defense = 32,
		},
	},
	w_dm = {
		stat = {
			armor = 180,
			cr_dodge = 12,
		},
	},
	w_def30 = {
		stat = {
			cr_skill_defense = 30,
		},
	},
	f_solarian = {
		stat = {
			stamina = 30,
		},
	},
	zuljin = {
		stat = {
			attackpower = 90,
		},
	},
}

offhand = {
	w_shield = {
		stat = {
			armor = 3711,
			blockvalue = 83,
			stamina = 33,
			cr_skill_defense = 24,
		},
	},
	moroes = {
		stat = {
			stamina = 19,
			intellect = 21,
			spirit = 22,
			healing = 37,
			spelldamage = 13,
		},
	},
	za_badge = {
		stat = {
			stamina = 18,
			intellect = 20,
			spirit = 25,
			healing = 55,
			spelldamage = 19,
		},
	},
	w_sh_badge = {
		stat = {
			armor = 4668,
			blockvalue = 115+33,
			stamina = 31,
			cr_skill_defense = 22,
		},
	},
	f_alar = {
		stat = {
			agility = 21,
			stamina = 30,
			attackpower = 40,
		},
	},
}

ranged = {
	w_bow = {
		stat = {
			strength = 7,
			stamina = 11,
			cr_skill_defense = 7,
		}
	},
	w_h_gun = {
		stat = {
			stamina = 21,
			cr_skill_defense = 13,
		}
	},
	shuriken = {
		stat = {
			stamina = 14,
			cr_hit = 12,
			cr_crit = 20,
		},
	},
}

for slot in pairs(utils.slots) do
	local table = _M[slot]
	if table then
		for _, entry in pairs(table) do
			assert(type(entry) == "table")
			assert(type(entry.stat) == "table")
			entry.slot = slot
		end
		setmetatable(table, utils.check_mt)
	end
end
